package com.biz.primus.commodity.vo.backend;

import com.biz.primus.base.enums.vendor.VendorType;
import com.biz.primus.base.vo.ExtendProductVo;
import com.biz.primus.base.vo.commodity.SaleStatus;
import com.biz.primus.commodity.enums.GbStatus;
import com.biz.primus.commodity.enums.GoodsKind;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author 江南
 * @usage
 * @reviewer
 * @since 2017/3/16
 */
@Data
@ApiModel("后台商品详情")
public class PlatformCommodityDetailVo implements Serializable {


    @ApiModelProperty("商品 ID")
    private String id;

    @ApiModelProperty("商品类型")
    private VendorType type;

    @ApiModelProperty("关键词Ids")
    private List<Long> keywordIds = Lists.newArrayList();

    @ApiModelProperty("标签Ids")
    private List<Long> saleTagIds = Lists.newArrayList();

    @ApiModelProperty("商品编码")
    private String productCode;

    @ApiModelProperty("主条码")
    private String barCode;

    @ApiModelProperty("商品简称")
    private String smallName;

    @ApiModelProperty("商品全称")
    private String name;

    @ApiModelProperty("商品英文简称")
    private String smallEnglishName;

    @ApiModelProperty("英文全称")
    private String englishName;

    @ApiModelProperty("分类Id")
    private Long categoryId;

    @ApiModelProperty("分类名称")
    private String categoryName;

    @ApiModelProperty("品牌Id")
    private Long brandId;

    @ApiModelProperty("品牌名称")
    private String brandName;

    @ApiModelProperty("产地")
    private String productArea;

    @ApiModelProperty("商品类型")
    private GoodsKind goodsKind;

    @ApiModelProperty("销售规格")
    private String goodsSpec;

    @ApiModelProperty("单位")
    private String unitName;

    @ApiModelProperty("商品重量")
    private Integer weight;

    @ApiModelProperty("箱规")
    private Integer orderPkNumber;

    @ApiModelProperty("状态")
    private GbStatus gbStatus;

    @ApiModelProperty("最低折扣率")
    private Double minZk;

    @ApiModelProperty("保质期")
    private String qualityGuaranteePeriod;

    @ApiModelProperty("最低存储温度")
    private Double lowTemp;

    @ApiModelProperty("最高存储温度")
    private Double highTemp;

    @ApiModelProperty("记录商品自身的扩展属性")
    private List<ExtendProductVo> extendProductVos;

    @ApiModelProperty("商品介绍信息")
    private List<String> introImages;

    @ApiModelProperty("商品 Logo")
    private String logo;

    @ApiModelProperty("商品主图(轮播图)")
    private List<String> images;

    @ApiModelProperty("积分比例")
    private Double pointsProportion;

    @ApiModelProperty("上下架总开关")
    private SaleStatus saleStatus;

    @ApiModelProperty("微商城渠道")
    private SaleStatus webSaleStatus;

    @ApiModelProperty("APP渠道")
    private SaleStatus appSaleStatus;

    @ApiModelProperty("seo 关键词 逗号分隔")
    private String seoKeywords;

    public String getIntroImages() {
        if (this.introImages != null){
            return Joiner.on(",").join(this.introImages);
        }
        return null;
    }

    public String getImages() {
        if (this.images != null){
            return Joiner.on(",").join(this.images);
        }
        return null;
    }

}
